<template>
  <div class="my-tabs">
    <div
      v-for="(item, index) in list"
      :key="index"
      class="my-tabs-item"
      :class="{ active: value == item.value }"
      @click="handleClickTab(item)"
    >
      <div class="label">{{ item.label }}</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      default: "1",
    },
    list: {
      default: () => [],
    },
  },
  methods: {
    handleClickTab(item) {
      this.$emit("update:value", item.value);
    },
  },
};
</script>

<style lang="less" scoped>
.my-tabs {
  display: flex;
  align-items: center;
  height: 100%;
  .my-tabs-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100%;
    cursor: pointer;
    user-select: none;
    color: #ee1e4f;
    border: 1px solid #ee1e4f;
    border-radius: 5px;
    margin-right: 30px;
    .label {
      font-size: 16px;
    }
  }
  .active {
    border: none;
    color: #fff;
    background: linear-gradient(to top, #ff7a82, #eea8a8);
  }
}
</style>